import { defineStore } from 'pinia'


/**
 * 服务于 pages-retrieval/filter/**
 */
export default defineStore('tabber', () => {
  const state = reactive({
    tabbarIndex: uni.getStorageSync('tabbarIndex')||0,
  })
  function change(index:number){
    state.tabbarIndex=index
    uni.setStorageSync('tabbarIndex',index)
  }



  return {
    tabbarIndex: computed(() => state.tabbarIndex|| 0),
    change
  }
})
